package tech.aistar.corejava.day02;

import java.util.Calendar;

/**
 * Created by 李雨昂 on 2019/7/18.
 */
public class CalendarDemo {
    public static void main(String[] args) {
        //获取日历对象
        Calendar cal = Calendar.getInstance();
        System.out.println(cal);

        //获取年
        int year = cal.get(Calendar.YEAR);
        System.out.println("year = " + year);
        //获取月
        int month = cal.get(Calendar.MONTH);
        System.out.println("month = " + month);
        //获取日
        int day = cal.get(Calendar.DATE);
        System.out.println("day = " + day);

        System.out.println(Calendar.YEAR);
    }
}
